package com.xjrsoft.module.workflow.controller;

import com.xjrsoft.common.result.Response;
import com.xjrsoft.core.tool.utils.BeanUtil;
import com.xjrsoft.module.workflow.service.IXjrNwfSchemeAuthService;
import com.xjrsoft.module.workflow.vo.NwfSchemeauthVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@AllArgsConstructor
@ControllerAdvice
@RestController
@RequestMapping("/workflow-Auth")
@Api(value = "工作流程模板权限控制器", tags = "工作流程模板权限控制器")
public class NwfAuthController {

    private IXjrNwfSchemeAuthService nwfSchemeAuthService;

    @GetMapping("/auth-user/nwfSchemeInfoId")
    @ApiImplicitParam(name = "nwfSchemeInfoId", dataType = "string", paramType = "query",value = "流程模板id")
    public Response getAuthUserByNwfInfoId(String nwfSchemeInfoId) {
        return Response.ok(BeanUtil.copyList(nwfSchemeAuthService.getBySchemeInfoId(nwfSchemeInfoId), NwfSchemeauthVo.class));
    }
}


